<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>王者荣耀竞猜管理平台</title>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/jquery-easyui-1.5.3/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/jquery-easyui-1.5.3/themes/icon.css">
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/static/jquery-easyui-1.5.3/jquery.min.js"></script>
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/static/jquery-easyui-1.5.3/jquery.easyui.min.js"></script>
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/static/jquery-easyui-1.5.3/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
<div align="center">
    <form id="ff" method="post" action="/userInfo/update" enctype="multipart/form-data">
        <input type="hidden" name="fdId" value="${userInfo.fdId}">
        <table cellpadding="5">
            <tr>
                <td>用户昵称：</td>
                <td><input class="easyui-textbox" type="text" id="fdNickname" name="fdNickname"
                           value="${userInfo.fdNickname}"
                           data-options="required:true"/></td>
            </tr>
            <tr>
                <td>用户类型：</td>
                <td><input type="radio" name="fdType" value="1" ${userInfo.fdType == 1?'checked':''} />普通会员
                    <input type="radio" name="fdType" value="0" ${userInfo.fdType == 0?'checked':''} />系统用户
                </td>
            </tr>
            <tr>
                <td>用户头像：</td>
                <td>
                    <c:choose>
                        <c:when test="${userInfo.fdAvatarUrl != null && userInfo.fdAvatarUrl != ''}">
                            <img src="${userInfo.fdAvatarUrl}" width="100px" height="100px"><br>
                            <input class="easyui-filebox" name="avatar" id="avatar"
                                   data-options="prompt:'选择图片...',buttonText:'选择头像',accept: 'image/*',buttonAlign:'right',editable:false">
                        </c:when>
                        <c:otherwise>
                            <input class="easyui-filebox" name="avatar" id="avatar"
                                   data-options="prompt:'选择图片...',buttonText:'选择头像',accept: 'image/*',buttonAlign:'right',editable:false">
                        </c:otherwise>
                    </c:choose>
                </td>
            </tr>
            <tr>
                <td>用户性别：</td>
                <td><input type="radio" name="fdSex" value="1" ${userInfo.fdSex == 1?'checked':''}/>男
                    <input type="radio" name="fdSex" value="0" ${userInfo.fdSex == 0?'checked':''} />女
                </td>
            </tr>
            <tr>
                <td>密保邮箱：</td>
                <td><input class="easyui-textbox" type="text" id="fdEmail" name="fdEmail" value="${userInfo.fdEmail}"
                           data-options="required:true"/></td>
            </tr>
            <tr>
                <td>用户手机：</td>
                <td><input class="easyui-textbox" type="text" id="fdMobile" name="fdMobile" value="${userInfo.fdMobile}"
                           data-options="required:true"/></td>
            </tr>
            <tr>
                <td>所属代理商：</td>
                <td><input id="fdMerchant" name="fdMerchant" class="easyui-combobox" data-options="
                    valueField: 'fdId',
                    textField: 'fdName',
                    editable:false,
                    url: '/merchantInfo/comboList',
                    onSelect:function(record){
                        $('#fdMerchantName').val(record.fdName);
                    },
                    onLoadSuccess: function (data) {
                       var m = $('#merchant').val();
                       $('#fdMerchant').combobox('select', m);
                    }"/>
                    <input name="fdMerchantName" id="fdMerchantName" type="hidden">
                    <input type="hidden" id="merchant" value="${userInfo.fdMerchant}">
                </td>
            </tr>
            <tr>
                <td>用户状态：</td>
                <td>
                    <input type="radio" name="fdStatus" value="1" ${userInfo.fdStatus == 1?'checked':''} />正常
                    <input type="radio" name="fdStatus" value="0" ${userInfo.fdStatus == 0?'checked':''} />禁用
                </td>
            </tr>
            <tr>
                <td>推荐码：</td>
                <td><input class="easyui-textbox" type="text" id="fdRecommendCode" name="fdRecommendCode"
                           value="${userInfo.fdRecommendCode}"
                           data-options="required:true"/></td>
            </tr>
            <tr>
                <td>我的推荐码：</td>
                <td><input class="easyui-textbox" type="text" id="fdMyCode" name="fdMyCode" value="${userInfo.fdMyCode}"
                           data-options="required:true"/></td>
            </tr>
            <tr>
                <td>用户角色：</td>
                <td><input id="fdRoleId" name="fdRoleId" class="easyui-combobox" data-options="
                    valueField: 'fdId',
                    textField: 'fdName',
                    editable:false,
                    url: '/sysRole/comboList',
                    onSelect:function(record){
                        $('#fdRoleName').val(record.fdName);
                    },
                    onLoadSuccess: function (data) {
                       var roleId = $('#role').val();
                       $('#fdRoleId').combobox('select', roleId);
                    }"/>
                    <input type="hidden" id="role" value="${userInfo.fdRoleId}">
                    <input type="hidden" id="fdRoleName" name="fdRoleName" value="${userInfo.fdRoleName}">
                </td>
            </tr>
        </table>
    </form>
    <div style="text-align:center;padding:5px">
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">提交</a>
        <a href="javascript:void(0)" style="margin-left: 20px" class="easyui-linkbutton" onclick="clearForm()">重置</a>
    </div>
</div>
</body>
<script src="${pageContext.request.contextPath}/static/pages/userInfo/edit.js"></script>
</html>
